#!/bin/bash

# Make sure we're not confused by old, incompletely-shutdown httpd
# context after restarting the container.  httpd won't start correctly
# if it thinks it is already running.
rm -rf /run/httpd/* /tmp/httpd*

APACHE_PARAMETERS="-DFOREGROUND "

if [ -n "$KIWI_DONT_ENFORCE_HTTPS" ]; then
    echo "Not enforcing HTTPS by rewriting HTTP requests"
    APACHE_PARAMETERS+="-DKIWI_DONT_ENFORCE_HTTPS "
fi

exec /usr/sbin/apachectl ${APACHE_PARAMETERS}
